home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / pump_src / setup / shell.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-10-26  |  1.2 KB  |  65 lines

  1. {$M 4096,0,4096}
  2. {$X+}
  3.  
  4.  
  5. USES DOS, Crt, LibFile, Devices;
  6.  
  7. CONST
  8.   MainFile='PUMP.EXE';
  9.   VtoFileSpec='C:\PUMP.VTO';
  10.   MINIMUM_MEM=575000;
  11.  
  12. VAR
  13.   f:file;
  14.  
  15. Procedure CheckMem;
  16. Var Mem:Word;
  17. Begin
  18.   asm
  19.     mov ah,48h
  20.     mov bx,0ffffh
  21.     int 21h
  22.     mov Mem,bx
  23.   end;
  24.   If LongInt(Mem)*16<MINIMUM_MEM then Begin
  25.      Writeln('Insufficient Memory to run this program.');
  26.      Writeln('Try to get more conventional memory');
  27.      Halt(1);
  28.   End;
  29. End;
  30.  
  31. BEGIN
  32.     { Memoria }
  33.     {CheckMem;}
  34.  
  35.     { Borrar el VTO si existe }
  36.     Assign(f, VtoFileSpec);
  37.     {$I-}
  38.     Reset(f);
  39.     {$I+}
  40.     if Ioresult = 0 then
  41.       Erase(f);
  42.  
  43.     { Ejecutar el setup }
  44.     FicheroExe := MainFile;
  45.     CommandLine := '';
  46.     ExecFile(LF_FindFile('SETUP.EXE')^.offs);
  47.  
  48.     { Si existe el VTO, ejecutar }
  49.     Assign(f, VtoFileSpec);
  50.     {$I-}
  51.     Reset(f);
  52.     {$I+}
  53.     if IOResult = 0 THEN BEGIN
  54.       Close(f);
  55.       { Ejecutar PUMP.EXE a través de SHELL.EXE }
  56.       FicheroExe := MainFile;
  57.       CommandLine := '@'+ VtoFileSpec;
  58. {      ExecFile(LF_FindFile('DEMOVT.EXE')^.offs);}
  59.       Exec('DEMOVT.DAT',CommandLine);
  60.       Assign(f, VtoFileSpec);
  61.       Erase(f);
  62.       Writeln('(c) 1995 Iguana.')
  63.     END
  64. END.
  65.